var import_electron = require("electron");
const isDevelopment = process.env.NODE_ENV !== "production";
async function createWindow() {
  const win = new import_electron.BrowserWindow({
    width: 920,
    height: 650,
    webPreferences: {
      // Use pluginOptions.nodeIntegration, leave this alone
      // See nklayman.github.io/vue-cli-plugin-electron-builder/guide/security.html#node-integration for more info
      nodeIntegration: process.env.ELECTRON_NODE_INTEGRATION,
      contextIsolation: !process.env.ELECTRON_NODE_INTEGRATION
    }
  });
  if (process.env.VITE_DEV_SERVER_URL) {
    win.loadURL(process.env.VITE_DEV_SERVER_URL);
  } else {
    win.loadFile("dist/index.html");
    log.transports.file.level = "debug";
  }
  import_electron.Menu.setApplicationMenu(null);
}
import_electron.app.on("window-all-closed", () => {
  if (process.platform !== "darwin") {
    import_electron.app.quit();
  }
});
import_electron.app.on("activate", () => {
  if (import_electron.BrowserWindow.getAllWindows().length === 0)
    createWindow();
});
import_electron.app.on("ready", async () => {
  createWindow();
});
if (isDevelopment) {
  if (process.platform === "win32") {
    process.on("message", (data) => {
      if (data === "graceful-exit") {
        import_electron.app.quit();
      }
    });
  } else {
    process.on("SIGTERM", () => {
      import_electron.app.quit();
    });
  }
}
